{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">商品名称</label>
        <div class="layui-input-block">
            <input id="c-title" lay-verify="required" class=" layui-input" name="row[title]" type="text" value="{$data.title}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图片</label>
        <div class="layui-input-block">
            <div class="layui-col-xs4">
                <input id="c-image" lay-verify="required" class=" layui-input" size="50" name="row[image]" type="text" value="{$data.image}">
            </div>
            <button type="button" id="faupload-image" class="layui-btn faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="layui-icon layui-icon-upload"></i> 上传</button><button type="button" id="fachoose-image" class="layui-btn fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="iconfont icon-other"></i> 选择</button>
            <ul class="layui-row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-block">
            <input id="c-goods_cate_id" lay-verify="" data-source="admin/goods_cate/index" class="selectpage layui-input" name="row[goods_cate_id]" type="text" value="{$data.goods_cate_id}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">价格</label>
        <div class="layui-input-block">
            <input id="c-price" lay-verify="required" class=" layui-input" step="0.01" name="row[price]" type="number" value="{$data.price}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">总库存</label>
        <div class="layui-input-block">
            <input id="c-stock" lay-verify="required" class=" layui-input" name="row[stock]" type="number" value="{$data.stock}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">剩余库存</label>
        <div class="layui-input-block">
            <input id="c-residue_stock" lay-verify="required" class=" layui-input" name="row[residue_stock]" type="number" value="{$data.residue_stock}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">销量</label>
        <div class="layui-input-block">
            <input id="c-sales" lay-verify="required" class=" layui-input" name="row[sales]" type="number" value="{$data.sales}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="row[status]" value="1" title="显示" {if $data.status==1}checked{/if}>
            <input type="radio" name="row[status]" value="0" title="隐藏" {if $data.status==0}checked{/if}>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input id="c-sort" lay-verify="required" class=" layui-input" name="row[sort]" type="number" value="{$data.sort}">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">内容</label>
        <div class="layui-input-block">
            {:Form::ueditor('row[content]',$data.content)}

        </div>
    </div>
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use('yznForm', function() {
    var yznForm = layui.yznForm;
    yznForm.bindevent($("form.layui-form"));
});
</script>
{/block}